package thread;

public class ThreadInfoDemo {
    public static void main(String[] args) {
        Thread main=Thread.currentThread();
        System.out.println(main);
        doSomething();
    }
    public static void doSomething(){
        Thread t=Thread.currentThread();
        System.out.println("运行doSamething方法的线程是"+t);
        String name=t.getName();
        System.out.println("线程名称是"+name);
        long id=t.getId();
        System.out.println("线程id是"+id);
        int priority=t.getPriority();
        System.out.println("线程优先级是"+priority);
        System.out.println("线程是否是守护线程"+t.isDaemon());
    }
}
